package org.aspectsense.dsl;
import java.util.logging.Logger;

import org.antlr.runtime.*;
import org.osgi.framework.BundleActivator;
import org.osgi.framework.BundleContext;

public class Activator implements BundleActivator {

	private static final Logger logger = Logger.getLogger(Activator.class.getCanonicalName());
	
	public void start(BundleContext context) throws Exception {
	
		
		 
		String in = "((8 + (5 - 4)*2) / 2 * 3)==15 ? 1 : 0 ";
		
		// create a CharStream that reads from String
		ANTLRStringStream input = new ANTLRStringStream(in);
		// create a lexer that feeds off of input CharStream
		utilityLexer lexer = new utilityLexer(input);
		// create a buffer of tokens pulled from the lexer
		CommonTokenStream tokens = new CommonTokenStream(lexer);
		// create a parser that feeds off the tokens buffer
		utilityParser parser = new utilityParser(tokens);
		// Begin parsing at rule prog
		parser.prog();		
	}
	
	/*
	 * (non-Javadoc)
	 * @see org.osgi.framework.BundleActivator#stop(org.osgi.framework.BundleContext)
	 */
	public void stop(BundleContext context) throws Exception {
		System.out.println("Goodbye World!!");
	}

}
